import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import "@/assets/js/base"
// import 'element-ui/lib/theme-chalk/index.css';
import "@/assets/css/xw-index.scss";
import {request,getUserInfo,baseURL } from "@/utils/request";
import "@/utils/BackGroudColor"
import "@/utils/MyMessage"

import tinymce from 'tinymce';
Vue.prototype.$tinymce = tinymce;


Vue.use(ElementUI)
Vue.config.productionTip = false

Vue.prototype.request = request
Vue.prototype.getUserInfo = getUserInfo
Vue.prototype.baseURL = baseURL

Vue.filter("dateFormatHms", function (originVal) {
  const dt = new Date(originVal);

  const y = dt.getFullYear();
  const m = (dt.getMonth() + 1 + "").padStart(2, "0");
  const d = (dt.getDate() + "").padStart(2, "0");

  const hh = (dt.getHours() + "").padStart(2, "0");
  const mm = (dt.getMinutes() + "").padStart(2, "0");
  const ss = (dt.getSeconds() + "").padStart(2, "0");

  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`;
});


Vue.filter("dateFormat", function (originVal) {
  const dt = new Date(originVal);

  const y = dt.getFullYear();
  const m = (dt.getMonth() + 1 + "").padStart(2, "0");
  const d = (dt.getDate() + "").padStart(2, "0");

  const hh = (dt.getHours() + "").padStart(2, "0");
  const mm = (dt.getMinutes() + "").padStart(2, "0");
  const ss = (dt.getSeconds() + "").padStart(2, "0");

  return `${y}-${m}-${d}`;
});

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
